package com.lagou.page.controller;

import com.lagou.entity.Result;
import com.lagou.entity.StatusCode;
import com.lagou.page.service.PageService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Fxz
 * @version 1.0
 * @date 2021-10-07 15:41
 */
@AllArgsConstructor
@RequestMapping("/page")
@RestController
public class PageController {

    private final PageService pageService;

    /**
     * @param id
     * @return
     */
    @GetMapping("/createHtml/{id}")
    public Result createHtml(@PathVariable(name = "id") String id) {
        pageService.createHtml(id);
        return new Result(true, StatusCode.OK,"success");
    }
}
